﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IList<MyMainSite.Models.BlogEntry>>" %>

<% foreach (var e in Model)
{ %>

    <article>
        <header>
            <% if (e.Blog.ProjectId != null)
               { %>
                <a href="/projects/index/<%: e.Blog.Project.FriendlyUrl %>/" title="<%: e.Blog.Project.Name %>" class="menuItem"><%: e.Blog.Project.Name %></a>&nbsp;-&nbsp;
            <% } %>
            <a href="/blog/index/<%= e.Blog.FriendlyUrl %>/<%: e.FriendlyUrl %>" class="menuItem"><%: e.Title %> - <time datetime="<%: e.DateCreated.ToString("yyyy-MM-dd") %>"><%: e.DateCreated.ToString("dd/MM/yyyy") %></time></a>
        </header>
        <section>
            <% if (Model.Count == 1)
               { %>
                <%= e.BodyHtml%>
            <% }
               else
               { %>
                <%= e.BodyIntroHtml%>
                <p><a href="/blog/index/<%= e.Blog.FriendlyUrl %>/<%: e.FriendlyUrl %>" class="readMoreLink">Read More</a></p>
            <% } %>
        </section>
    </article>

<% } %>